<?php

/**
 * history actions.
 *
 * @package    raidpoints
 * @subpackage history
 * @author     Your name here
 * @version    SVN: $Id: actions.class.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
 */
class ajaxActions extends sfActions
{
    public function executePlayer($request)
    {
        $this->getResponse()->setContentType('application/json');

        $players = Doctrine::getTable("Player")->ajaxAutocompleter($request->getParameter('q'));

        return $this->renderText(json_encode($players));
    }
    public function executeReason($request)
    {
        $this->getResponse()->setContentType('application/json');

        $players = Doctrine::getTable("Reason")->ajaxAutocompleter($request->getParameter('q'));

        return $this->renderText(json_encode($players));
    }
    public function executeRaid($request)
    {
        $this->getResponse()->setContentType('application/json');

        $players = Doctrine::getTable("Raid")->ajaxAutocompleter($request->getParameter('q'));

        return $this->renderText(json_encode($players));
    }
    public function executeTalent($request)
    {
        $this->getResponse()->setContentType('application/json');

        $players = Doctrine::getTable("Talent")->ajaxAutocompleter($request->getParameter('q'));

        return $this->renderText(json_encode($players));
    }
    public function executeClass($request)
    {
        $this->getResponse()->setContentType('application/json');

        $players = Doctrine::getTable("PClass")->ajaxAutocompleter($request->getParameter('q'));

        return $this->renderText(json_encode($players));
    }

}
